package org.hxzon.workeasy.pages.contacts;

import java.util.List;

import org.apache.tapestry5.EventConstants;
import org.apache.tapestry5.annotations.OnEvent;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SetupRender;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.hxzon.workeasy.model.EasyContacts;
import org.hxzon.workeasy.pages.base.MyBasePage;
import org.hxzon.workeasy.service.EasyContactsService;

public class ListContacts extends MyBasePage {
    @Inject
    private EasyContactsService contactsSer;

    @Property
    private List<EasyContacts> list;

    @OnEvent(value = EventConstants.ACTIVATE)
    Object init() {
        checkUserIsAdmin();
        return null;
    }

    @SetupRender
    Object display() {
        list = contactsSer.findAll();
        return null;
    }

}
